/*
 * @Author: 码农 2646995216@qq.com
 * @Date: 2025-02-23 21:25:47
 * @LastEditors: 码农 2646995216@qq.com
 * @LastEditTime: 2025-02-23 21:39:48
 * @FilePath: /signal/a.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

#include <iostream>
#include <unistd.h>
#include <sys/types.h>
#include <signal.h>
#include <cerrno>
#include <cstring>

using namespace std;

int main(int argc, char *argv[])
{

	if (argc != 3)
    {
        cout << "Usage: kill -signum pid" << endl;
        return 1;
    }
	
	for(int i=0;i<argc;i++)
	{
		cout<<argv[i]<<endl;
	}
    /*if (argc != 3)
    {
        cout << "Usage: kill -signum pid" << endl;
        return 1;
    }

	
    int signum = stoi(argv[1] + 1); // 获取信号的数字
    int pid = stoi(argv[2]);        // 获取pid

    int n = kill(pid, signum);
    if (n == -1)
    {
        //cerr << "kill failed: " << strerror(errno) << endl;
    }*/
    return 0;
}
